package routers

import (
	"github.com/gin-gonic/gin"
	"permange/middleWare"
)

func sysNoCheckRoleRouter(r *gin.RouterGroup) {
	r = r.Group("/apis")
	departmentRouter(r)
	leavejobRouter(r)
	postsRouter(r)
	newempRouter(r)
	employeeRouter(r)
	partmonthRouter(r)
	leaveempRouter(r)
}

func InitRouter() *gin.Engine {
	r := gin.New()
	r.Use(gin.Logger())
	r.Use(gin.Recovery())
	r.Use(middleWare.Cors())
	g := r.Group("/permange")

	sysNoCheckRoleRouter(g)

	return r
}